# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ChannelPartnerLink do
  @moduledoc """
  Entity representing a link between distributors and their indirect resellers in an n-tier resale channel.

  ## Attributes

  *   `channelPartnerCloudIdentityInfo` (*type:* `GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1CloudIdentityInfo.t`, *default:* `nil`) - Output only. Cloud Identity info of the channel partner (IR).
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of when the channel partner link is created.
  *   `inviteLinkUri` (*type:* `String.t`, *default:* `nil`) - Output only. URI of the web page where partner accepts the link invitation.
  *   `linkState` (*type:* `String.t`, *default:* `nil`) - Required. State of the channel partner link.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name for the channel partner link, in the format accounts/{account_id}/channelPartnerLinks/{id}.
  *   `publicId` (*type:* `String.t`, *default:* `nil`) - Output only. Public identifier that a customer must use to generate a transfer token to move to this distributor-reseller combination.
  *   `resellerCloudIdentityId` (*type:* `String.t`, *default:* `nil`) - Required. Cloud Identity ID of the linked reseller.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of when the channel partner link is updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :channelPartnerCloudIdentityInfo =>
            GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1CloudIdentityInfo.t() | nil,
          :createTime => DateTime.t() | nil,
          :inviteLinkUri => String.t() | nil,
          :linkState => String.t() | nil,
          :name => String.t() | nil,
          :publicId => String.t() | nil,
          :resellerCloudIdentityId => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:channelPartnerCloudIdentityInfo,
    as: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1CloudIdentityInfo
  )

  field(:createTime, as: DateTime)
  field(:inviteLinkUri)
  field(:linkState)
  field(:name)
  field(:publicId)
  field(:resellerCloudIdentityId)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder,
  for: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ChannelPartnerLink do
  def decode(value, options) do
    GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ChannelPartnerLink.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ChannelPartnerLink do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
